import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
// 页面
import './counter_page.dart';
import './user_page.dart';
import './cart_page.dart';

class ProvoderPageRouteMap {
  final String providerTest = 'provider_test';
  final String counterPage = 'counter_page';
  final String userPage = 'user_page';
  final String cartPage = 'cart_page';

  static void Function(FluroRouter) define = handleDefine;
}

void handleDefine(FluroRouter router) {
  ProvoderPageRouteMap routeMap = ProvoderPageRouteMap();

  router.define(
    routeMap.counterPage,
    handler: Handler(
      handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
        return CounterPage();
      },
    ),
  );

  router.define(
    routeMap.userPage,
    handler: Handler(
      handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
        return UserPage();
      },
    ),
  );

  router.define(
    routeMap.cartPage,
    handler: Handler(
      handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
        return CartPage();
      },
    ),
  );
}
